<style lang="less" scoped>
    .gum {
        width: 100%;
        height: auto;
        overflow: hidden;
        text-align: center;
        padding: 8px;
        display: flex;
    }
</style>
<template>
    <div class="gum">
        <card-table
            table="2"
            cardtitle="背胶参数库"
            :columns="columns"
            :selectList="selectList"
            :defaultSelete="defaultSelete"
            :searchForm="searchForm"
            :formItem="formItem"
            :addbtn="false"
            @refresh="refresh"
            @on-current-change="onCurrentChange"
            :data="data">
            <div slot="elmtable">
                <el-table-column
                    label="">
                    <template slot-scope="scope">
                        <img :src="scope.row.bj_photo" alt="" width="30px" height="30px" style="cursor: pointer;margin: 0 auto;" @click="showimg(scope.row.bj_photo)">
                    </template>
                </el-table-column>
                <!--<el-table-column
                    fixed="right"
                    label="操作"
                    width="80">
                    <template slot-scope="scope">
                        <Button type="text" @click="xqclick(scope.row)">详情</Button>
                    </template>
                </el-table-column>-->
            </div>
        </card-table>
    </div>
</template>
<script>
    import CardTable from '../components/cardTable.vue'
    import MyCard from '../components/myCard.vue'
    export default {
        name: 'gum',
        data () {
            return {
                columns: [
                    {
                        title: '产品编号',
                        key: 'nub',
                        width: 160,
                        fixed: 'left'
                    },
                    {
                        title: '产品名称',
                        key: 'name',
                        width: 160,
                        fixed: 'left'
                    },
                    {
                        title: '工艺参数',
                        key: '',
                        children: [
                            {
                                title: '机台',
                                key: 'bj_jt',
                                width: 80
                            },
                            {
                                title: '气动喷涂底涂剂',
                                key: '',
                                children: [
                                    {
                                        title: '气压',
                                        key: 'bj_qy',
                                        width: 80
                                    },
                                    {
                                        title: '持续时间',
                                        key: 'bj_cxsj',
                                        width: 80
                                    },
                                    {
                                        title: '间隔时间',
                                        key: 'bj_jgsj',
                                        width: 80
                                    }
                                ]
                            },
                            {
                                title: '飞毛',
                                key: '',
                                children: [
                                    {
                                        title: '风量大小',
                                        key: 'bj_fldx'
                                    },
                                    {
                                        title: '牵引速度',
                                        key: 'bj_qysd'
                                    }
                                ]
                            },
                            {
                                title: '铲梳电机转速',
                                key: 'bj_csdjzs',
                                width: 110
                            },
                            {
                                title: '剃毛刀速度',
                                key: 'bj_tmdsd',
                                width: 110
                            }
                        ]
                    },
                    {
                        title: '品质要求',
                        key: '',
                        children: [
                            {
                                title: '胶带与带子状态',
                                key: 'bj_wz',
                                width: 130
                            },
                            {
                                title: '剥离力',
                                key: 'bj_bll',
                                width: 130
                            }
                        ]
                    },
                    {
                        title: '图号',
                        key: 'version',
                        width: 80,
                        fixed: 'right'
                    }
                ],
                data: [],
                selectList: [
                    {
                        label: '产品编号',
                        value: 'nub'
                    },
                    {
                        label: '产品名称',
                        value: 'name'
                    },
                    {
                        label: '图号',
                        value: 'version'
                    }
                ],  //  搜索下拉列表
                defaultSelete: 'nub',  //  搜索下拉列表默认值
                searchForm: {
                    'nub': '',
                    'name': '',
                    'bj_jt': '',
                    'bj_qy': '',
                    'bj_cxsj': '',
                    'bj_jgsj': '',
                    'bj_fldx': '',
                    'bj_qysd': '',
                    'bj_cldjzs': '',
                    'bj_tmdsd': '',
                    'version': ''
                },  //  表单初始值
                formItem: [
                    {
                        label: '产品编号',
                        key: 'nub',
                        placeholder: '输入产品编号'
                    },
                    {
                        label: '产品名称',
                        key: 'name',
                        placeholder: '输入产品名称'
                    },
                    {
                        label: '图号',
                        key: 'version',
                        placeholder: '输入图号'
                    }
                ],  //  搜索表单item
                current: null
            }
        },
        methods: {
            showimg (url) {
            },
            xqclick (row) {
                console.log('当前点击事件', row)
            },
            refresh () {
                this.http.getGycs(this, {}, 'beijiao/getAllBeijiao')
            },
            onCurrentChange (current) {
                console.log('current', current)
                this.current = current
            }
        },
        components: {
            CardTable,
            MyCard
        },
        mounted: function () {
            this.http.getGycs(this, {}, 'beijiao/getAllBeijiao')
        }
    };
</script>
